#include <bits/stdc++.h>
using namespace std;
int countroom(vector<pair<int,int>>& a)
{

    int sum_result = 0,ans = 0;
    vector<pair<int,int>>tmp;
    int ret;
    for(auto i:a)
    {
        tmp.push_back({i.first,1});
        tmp.push_back({i.second,-1});
    }
    sort(tmp.begin(),tmp.end());
    for(auto i:tmp)
    {
        sum_result += i.second;
        if(sum_result>ans)
            ans = sum_result;
    }
    return ans;
}
int main() {
    vector<pair<int,int>> a = {{0,30},{5,10},{15,20}};
    cout<<countroom(a);
    return 0;
}